import request from '@/router/axios';
import store from '@/store';
import moment from 'moment';
import {
  clearSelect, fenExYuangettoFixed,
  getgetStationCodes,
  getLineCodes, getLineName, getMappingStatus, getQianxiangType, getStationName, getUninstall,
  getXieChaStatusFormat, setSearchFiledsEmpty,
  xieChaStatus
} from "../../../../../../../api/subwayRat/commonCheck";


/**
 * 车站提交
 * @param query
 */
export function getSwAuTvmCashboxAmountHierarchyDifferenceList(query) {
  return request({
    url: '/check/checkNew/get_xw_SwAuTvmCashAmountHierarchyDifferenceListKY',
    method: 'post',
    params: query,
    data:query
  })
}


/**
 * 其他运营中心列表
 * @param query
 */
 export function getSwAuTvmCashboxAmountHierarchyDifferenceListOther(query) {
  return request({
    url: '/check/checkNew/get_xw_SwAuTvmCashAmountHierarchyDifferenceListOther',
    method: 'post',
    params: query,
    data:query
  })
}
/**
 * 确认提交
 * @param query
 */
export function submitSwAuTvmCashboxAmountHierarchyDifference(query) {
  return request({
    url: '/check/checkNew/submitSwAuTvmCashboxAmountHierarchyDifference',
    method: 'post',
    params: query
  })
}


/**
 * 批量提交
 * @param query
 */
export function batchSwAuTvmCashboxAmountHierarchyDifference(query) {
  return request({
    url: '/check/checkNew/batchSwAuTvmCashboxAmountHierarchyDifference',
    method: 'post',
    params: query
  })
}

/**
 * 修改
 * @param query
 */
export function updateSwAuTvmCashboxAmountHierarchyDifference(query) {
  return request({
    url: '/check/checkNew/updateSwAuTvmCashboxAmountHierarchyDifference',
    method: 'post',
    data: query,
    params: query
  })
}


export function FQXCJCY_option(menu){return{
  emptyBtn:false,
  editBtn:false,
  delBtn:false,
  addBtn:false,
  border: true,
  index:true,
  indexLabel:'序号',
  page:true,
  align:'center',
  menu:menu,
  menuWidth:150,
  menuAlign:'center',
  selection: true,
  reserveSelection:false,
  column:[{"label":"线路",
    prop:"lineCode",type:'select',search:true,searchslot:true,formatter: function(row, value , label, column){
      return getLineName(value);
    }},
    {"label":"站点",
      prop:"stationCode",type:'select',search:true,searchslot:true,formatter: function(row, value , label, column){
        return getStationName(row.lineCode,value);
      }},
    {"label":"TVM编号",
      prop:"tvmOrder",type:'select',search:true,searchslot:true},
    {"label":"钱箱类型",
      prop:"tvmMoneyType",formatter :function(row, value , label, column){
        return getQianxiangType(value);
      },},
    {"label":"钱箱编号",
      prop:"tvmMoneyOrder",search:true,},
    // {"label":"卸载状态",
    //   prop:"boxUninstallStatus",formatter:function (row,v) {
    //     return getUninstall(v);
    //   }},
    {"label":"结账单据金额",width:120,
      prop:"depositAmount",formatter:function (row,value , label, column) {
        return fenExYuangettoFixed(row,'depositAmount');
      }},
    {"label":"SC系统清点金额",width:160,
      prop:"saleAmount",formatter:function (row,value , label, column) {
        return fenExYuangettoFixed(row,'saleAmount');
      }},
    {"label":"系统清点差异金额",width:160,prop:"qingdian",formatter:function(row, value , label, column){
        let chayi=Number(row.depositAmount)-Number(row.saleAmount);
        row.qingdian=chayi;
        return fenExYuangettoFixed(row,'qingdian');
      }},
    // {"label":"协查状态",search:true,dicData:xieChaStatus(),
    //   formatter:function(row, value , label, column){
    //     return getXieChaStatusFormat(value);
    //   }, prop:"assistStatus"},
    {"label":"收入日期",
      prop:"settleTime",search:true,searchslot:true},
    {"label":"通知时间",
      prop:"sendAssistTime",formatter:function (row,v) {
        return moment(v).format("YYYY-MM-DD");
      }},
    {"label":"归属机电专业回馈",width:160,
      prop:"jdReplyReason",formatter:function (row,v) {
        return getMappingStatus("JD_REPLY_REASON",v);
      }},
    {"label":"操作员", prop:"jdOperatorName"},
    {"label":"操作员工号",prop:"jdOperatorCode"}
  ]}
};




export const FQXCJCY_cols1=[{
  label: '系统层级',
  prop: "type",
  formslot: true,
},
  {
    width:120,
    label: '系统清点金额',
    prop: "saleAmount",
    formslot: true,
  },
  {
    label: '差异金额',
    prop: "saleAmountCY",
    formslot: true,
  }]


export function getFQXCJCYMondifyData1(ob){
    console.log(ob)
    let one={};
    let two={};
    one.type="结账单据";
    one.saleAmount=ob.billOrderMoney;
    one.saleAmountCY='';

    two.type='SC';
    two.saleAmount=ob.saleAmount;
    two.saleAmountCY=ob.saleAmount-ob.billOrderMoney;

    let res=[];
    res.push(one);
    res.push(two);
    return res;
  }

